package com.kingmed.kmss.common.exception;


import com.kingmed.kmss.common.enums.base.code.IResultCode;

/**
 * 自定义API异常(仅用于内部跨服务调用产生的异常，不要用在内部业务异常)
 */
public class InternalApiException extends RuntimeException {
    /**
	 *
	 */
	private static final long serialVersionUID = -4830173219306183990L;
	private IResultCode resultCode;

    public InternalApiException(IResultCode resultCode) {
        super(resultCode.getMessage());
        this.resultCode = resultCode;
    }

    public InternalApiException(String message) {
        super(message);
    }

    public InternalApiException(Throwable cause) {
        super(cause);
    }

    public InternalApiException(String message, Throwable cause) {
        super(message, cause);
    }

    public IResultCode getErrorCode() {
        return resultCode;
    }
}
